﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="pr.aspx.vb" Inherits="myaccount_pr" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        <br />
         
    
          <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1" Width="100%" PageSize="15" Font-Names="Tahoma" Font-Size="8pt" AutoGenerateColumns="False" DataKeyNames="prid">
              <Columns>
                  <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                  <asp:BoundField DataField="prid" HeaderText="prid" InsertVisible="False" ReadOnly="True" SortExpression="prid" Visible="False" />
                  <asp:BoundField DataField="PrNumber" HeaderText="PR Number" SortExpression="PrNumber" ReadOnly="True" />
                  <asp:BoundField DataField="Company" HeaderText="Company" SortExpression="Company" />
                  <asp:BoundField DataField="RequisitionName" HeaderText="Requisitioner" SortExpression="RequisitionName" />
                  <asp:BoundField DataField="ApprovedBy" HeaderText="Approved By" SortExpression="ApprovedBy" />
                  <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" Visible="False" />
                  <asp:CheckBoxField DataField="Status" HeaderText="Status" SortExpression="Status" />
                  <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment" />
                  <asp:BoundField DataField="TimeStamp" HeaderText="TimeStamp" SortExpression="TimeStamp" Visible="False" />
                  <asp:BoundField DataField="UploadedBy" HeaderText="UploadedBy" SortExpression="UploadedBy" Visible="False" />
              </Columns>
              <FooterStyle BackColor="White" ForeColor="#000066" />
              <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
              <PagerSettings PageButtonCount="15" />
              <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
              <RowStyle ForeColor="#000066" />
              <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
              <SortedAscendingCellStyle BackColor="#F1F1F1" />
              <SortedAscendingHeaderStyle BackColor="#007DBB" />
              <SortedDescendingCellStyle BackColor="#CAC9C9" />
              <SortedDescendingHeaderStyle BackColor="#00547E" />
          </asp:GridView>
    </p>
    <p>
    <hr />
         
    
          <asp:GridView ID="GridView3" runat="server" AllowPaging="True" AllowSorting="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource3" Width="100%" PageSize="15" Font-Names="Tahoma" Font-Size="8pt" AutoGenerateColumns="False" DataKeyNames="pr_id">
              <Columns>
                  <asp:CommandField ShowSelectButton="True" ButtonType="Button" />
                  <asp:BoundField DataField="pr_id" HeaderText="pr_id" InsertVisible="False" ReadOnly="True" SortExpression="pr_id" Visible="False" />
                  <asp:BoundField DataField="po_description" HeaderText="po_description" SortExpression="po_description" />
                  <asp:BoundField DataField="vendor" HeaderText="Vendor" SortExpression="vendor" />
                  <asp:BoundField DataField="costcenter" HeaderText="Costcenter" SortExpression="costcenter" />
                  <asp:BoundField DataField="extrended_desc" HeaderText="Ext. Description" SortExpression="extrended_desc" />
                  <asp:BoundField DataField="purchaser" HeaderText="Purchaser" SortExpression="purchaser" />
                  <asp:BoundField DataField="order_date" HeaderText="Order Date" SortExpression="order_date" />
                  <asp:BoundField DataField="extra2" HeaderText="extra2" SortExpression="extra2" Visible="False" />
              </Columns>
              <FooterStyle BackColor="White" ForeColor="#000066" />
              <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
              <PagerSettings PageButtonCount="15" />
              <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
              <RowStyle ForeColor="#000066" />
              <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
              <SortedAscendingCellStyle BackColor="#F1F1F1" />
              <SortedAscendingHeaderStyle BackColor="#007DBB" />
              <SortedDescendingCellStyle BackColor="#CAC9C9" />
              <SortedDescendingHeaderStyle BackColor="#00547E" />
          </asp:GridView>
    <p>
        &nbsp;</p>
    <hr />
         
    
          <asp:GridView ID="GridView4" runat="server" AllowPaging="True" AllowSorting="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlPOItemsSource" Width="100%" PageSize="15" Font-Names="Tahoma" Font-Size="8pt" AutoGenerateColumns="False" DataKeyNames="Po_Id">
              <Columns>
                  <asp:BoundField DataField="Po_Id" HeaderText="Po_Id" InsertVisible="False" ReadOnly="True" SortExpression="Po_Id" Visible="False" />
                  <asp:BoundField DataField="TimeStamp" HeaderText="TimeStamp" SortExpression="TimeStamp" Visible="False" />
                  <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" Visible="False" />
                  <asp:BoundField DataField="No_" HeaderText="No." SortExpression="No_" />
                  <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                  <asp:BoundField DataField="UnitOfMeas" HeaderText="Unit Of Measurement" SortExpression="UnitOfMeas" />
                  <asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" />
                  <asp:BoundField DataField="PricePU" HeaderText="Direct Amount" SortExpression="PricePU" />
                  <asp:BoundField DataField="Amount" HeaderText="Line Amount" SortExpression="Amount" />
                  <asp:BoundField DataField="extra1" HeaderText="extra1" SortExpression="extra1" Visible="False" />
                  <asp:BoundField DataField="extra2" HeaderText="extra2" SortExpression="extra2" Visible="False" />
              </Columns>
              <FooterStyle BackColor="White" ForeColor="#000066" />
              <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
              <PagerSettings PageButtonCount="15" />
              <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
              <RowStyle ForeColor="#000066" />
              <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
              <SortedAscendingCellStyle BackColor="#F1F1F1" />
              <SortedAscendingHeaderStyle BackColor="#007DBB" />
              <SortedDescendingCellStyle BackColor="#CAC9C9" />
              <SortedDescendingHeaderStyle BackColor="#00547E" />
          </asp:GridView>
    
    <table style="width:100%;">
        <tr>
            <td>
          <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [pr_header] WHERE [prid] = @prid" InsertCommand="INSERT INTO [pr_header] ([PrNumber], [Company], [RequisitionName], [ApprovedBy], [Status], [Comment], [TimeStamp], [UploadedBy]) VALUES (@PrNumber, @Company, @RequisitionName, @ApprovedBy, @Status, @Comment, @TimeStamp, @UploadedBy)" SelectCommand="SELECT * FROM [pr_header]" UpdateCommand="UPDATE [pr_header] SET [PrNumber] = @PrNumber, [Company] = @Company, [RequisitionName] = @RequisitionName, [ApprovedBy] = @ApprovedBy, [Status] = @Status, [Comment] = @Comment, [TimeStamp] = @TimeStamp, [UploadedBy] = @UploadedBy WHERE [prid] = @prid">
              <DeleteParameters>
                  <asp:Parameter Name="prid" Type="Int64" />
              </DeleteParameters>
              <InsertParameters>
                  <asp:Parameter Name="PrNumber" Type="String" />
                  <asp:Parameter Name="Company" Type="String" />
                  <asp:Parameter Name="RequisitionName" Type="String" />
                  <asp:Parameter Name="ApprovedBy" Type="String" />
                  <asp:Parameter Name="Status" Type="String" />
                  <asp:Parameter Name="Comment" Type="String" />
                  <asp:Parameter Name="TimeStamp" Type="String" />
                  <asp:Parameter Name="UploadedBy" Type="String" />
              </InsertParameters>
              <UpdateParameters>
                  <asp:Parameter Name="PrNumber" Type="String" />
                  <asp:Parameter Name="Company" Type="String" />
                  <asp:Parameter Name="RequisitionName" Type="String" />
                  <asp:Parameter Name="ApprovedBy" Type="String" />
                  <asp:Parameter Name="Status" Type="String" />
                  <asp:Parameter Name="Comment" Type="String" />
                  <asp:Parameter Name="TimeStamp" Type="String" />
                  <asp:Parameter Name="UploadedBy" Type="String" />
                  <asp:Parameter Name="prid" Type="Int64" />
              </UpdateParameters>
        </asp:SqlDataSource>
            </td>
            <td>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NAV FOODConnectionString %>" SelectCommand="SELECT [Buy-from Vendor No_] AS column1, [Order Date] AS Order_Date, [Shortcut Dimension 1 Code] AS Shortcut_Dimension_1_Code, [Purchaser Code] AS Purchaser_Code, [Posting Description] AS Posting_Description, [Extended Description] AS Extended_Description, No_ FROM [Epicurean Partners Exchange$Purchase Header] WHERE ([Extended Description] LIKE '%' + @Extended_Description + '%')">
            <SelectParameters>
                <asp:QueryStringParameter Name="Extended_Description" QueryStringField="item" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>
         
    
            </td>
            <td>
                <asp:SqlDataSource ID="POSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NAV FOODConnectionString %>" SelectCommand="SELECT Type, [Document No_] AS Document_No_, Description, [Unit of Measure] AS Unit_of_Measure, [Direct Unit Cost] AS Direct_Unit_Cost, [Line Amount] AS Amount, [Line No_] AS Line_No_, Quantity AS Quantity_ FROM [Epicurean Partners Exchange$Purchase Line] WHERE ([Document No_] = @Document_No_) ORDER BY Line_No_">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="Document_No_" QueryStringField="po" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [pr_rcpt] WHERE [pr_id] = @pr_id" InsertCommand="INSERT INTO [pr_rcpt] ([po_description], [vendor], [costcenter], [extrended_desc], [purchaser], [order_date], [extra2]) VALUES (@po_description, @vendor, @costcenter, @extrended_desc, @purchaser, @order_date, @extra2)" SelectCommand="SELECT [pr_id], [po_description], [vendor], [costcenter], [extrended_desc], [purchaser], [order_date], [extra2] FROM [pr_rcpt] WHERE ([extrended_desc] LIKE '%' + @extrended_desc + '%') ORDER BY [pr_id]" UpdateCommand="UPDATE [pr_rcpt] SET [po_description] = @po_description, [vendor] = @vendor, [costcenter] = @costcenter, [extrended_desc] = @extrended_desc, [purchaser] = @purchaser, [order_date] = @order_date, [extra2] = @extra2 WHERE [pr_id] = @pr_id">
            <DeleteParameters>
                <asp:Parameter Name="pr_id" Type="Int64" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="po_description" Type="String" />
                <asp:Parameter Name="vendor" Type="String" />
                <asp:Parameter Name="costcenter" Type="String" />
                <asp:Parameter Name="extrended_desc" Type="String" />
                <asp:Parameter Name="purchaser" Type="String" />
                <asp:Parameter Name="order_date" Type="String" />
                <asp:Parameter Name="extra2" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:QueryStringParameter Name="extrended_desc" QueryStringField="item" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="po_description" Type="String" />
                <asp:Parameter Name="vendor" Type="String" />
                <asp:Parameter Name="costcenter" Type="String" />
                <asp:Parameter Name="extrended_desc" Type="String" />
                <asp:Parameter Name="purchaser" Type="String" />
                <asp:Parameter Name="order_date" Type="String" />
                <asp:Parameter Name="extra2" Type="String" />
                <asp:Parameter Name="pr_id" Type="Int64" />
            </UpdateParameters>
        </asp:SqlDataSource>
            </td>
            <td>
                <asp:SqlDataSource ID="SqlPOItemsSource" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT Po_Id, TimeStamp, Type, No_, Description, UnitOfMeas, PricePU, Amount, extra1, extra2, Quantity FROM po_items WHERE (No_ = @No_) ORDER BY extra2">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="No_" QueryStringField="po" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
</asp:Content>

